bot-gh: fix silent PR auto-assign no-op on old gh, request owner review - #121
Merged
Merged
Conversation
…review-request The owner never got assigned to (or asked to review) any bot PR: the follow-up used gh's `-f "assignees[]=..."` bracket-array syntax, which older gh releases (e.g. Ubuntu 22.04's packaged 2.4.0) encode as a literal "assignees[]" STRING field. GitHub ignores the unknown field and still returns 200, so the soft-fail warning never fired — zero assigned events on every PR since the feature landed (#33). - Send both payloads as explicit JSON via `gh api --input -` (version-proof back to early gh 2.x). - Verify the RESPONSE names the owner instead of trusting the exit code (the exit code is exactly what lied here); warn loudly otherwise. - Add the missing second follow-up: request a formal review from the owner, so bot PRs land in their GitHub review queue and fire the review-requested notification. Author is always the bot, so the no-self-review-request rule cannot trip. Verified live against PR #117: the bracket-syntax call returned 200 with assignees untouched; the JSON-body call assigned the owner. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
robercano
approved these changes
Jul 15, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes the notification gap: bot PRs were never assigned to the owner and never requested their review.
Root cause
bot-gh.sh's post-create follow-up usedgh api -f "assignees[]=<owner>". The bracket array syntax doesn't exist on older gh releases (this box runs Ubuntu's packaged gh 2.4.0, 2022) — it sends a literal"assignees[]"string field, which the GitHub API ignores while returning 200. Exit code 0 → the soft-fail warning never fired → every bot PR since #33 landed shipped unassigned, silently. Verified live on PR #117: bracket-syntax call returns 200 withassignees: []; explicit-JSON call assigns correctly.Fix
gh api --input -— works on any gh 2.x.POST /pulls/N/requested_reviewers), so the PR lands in their GitHub review queue and fires the review-requested notification. The author is always the bot, so GitHub's no-self-review-request rule can't trip.Test
This PR is its own end-to-end test: it was created with the fixed script — check that it arrived assigned to @robercano with a review requested. Gates: self lint + test green in the worktree.
🤖 Generated with Claude Code